package com.taiyi.renaissancemall.ui.mine.order.ask_every_one;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.taiyi.renaissancemall.R;
import com.taiyi.renaissancemall.bean.AskEveryoneListBean;
import com.taiyi.renaissancemall.bean.MyScoresBean;

import java.util.List;

public class AskEveryoneListAdapter extends BaseQuickAdapter<AskEveryoneListBean.WelistBean, BaseViewHolder> {
    public AskEveryoneListAdapter(int layoutResId, @Nullable List<AskEveryoneListBean.WelistBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, AskEveryoneListBean.WelistBean item) {
        helper.setText(R.id.tv_ask_question, item.problemcontent);
        if (item.anslist.size() > 0) {
            helper.setText(R.id.tv_ask_answer, item.anslist.get(0).answercontent);
        } else {
            helper.setText(R.id.tv_ask_answer, "暂无回答");
        }
        String num = "";
        if (item.anslist != null
                && item.anslist.size() > 0) {
            num = "全部" + item.anslist.size() + "个回答";
        } else {
            num = "全部0个问题";
        }
        helper.setText(R.id.tv_ask_num, num);
        helper.setText(R.id.tv_ask_date, item.createtime);
    }
}
